import type { Instruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/list-item";
import type { ILayerItem } from "../base/DesignerTypes";

export type TreeAction =
  | {
      type: "instruction";
      instruction: Instruction;
      itemId: string;
      targetId: string;
    }
  | { type: "toggle"; itemId: string }
  | { type: "expand"; itemId: string }
  | { type: "collapse"; itemId: string }
  | { type: "modal-move"; itemId: string; targetId: string; index: number };

interface Openable {
  isOpen: boolean;
}

export interface TreeItem extends ILayerItem, Openable {
  children?: TreeItem[];
}
